//
//  YSCartBottomBar.m
//  Yueshi
//
//  Created by Northwan on 15/7/27.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "YSCartBottomBar.h"


@interface YSCartBottomBar()
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *statusLabel;


@end

@implementation YSCartBottomBar

+(instancetype)bottomBar{
    return [[[NSBundle mainBundle]loadNibNamed:@"YSCartBottomBar" owner:nil options:nil]lastObject];
}

-(void)setPrice:(CGFloat)price{
    if(price==0)
        [self.priceLabel setText:@"¥0.0"];
    else
        [self.priceLabel setText:[NSString stringWithFormat:@"¥%.1f",price]];
}

- (IBAction)tapAccount:(id)sender {
    NSLog(@"结算");
    if(self.toAccountCenter){
        self.toAccountCenter();
    }
}

- (IBAction)tapStatus:(id)sender {
   [self.statusBtn setSelected:!self.statusBtn.selected];
   if(self.operation){
        self.operation();
   }
}

@end
